package com.hxzy.shop.feign.merchant;

import com.github.pagehelper.PageInfo;
import com.hxzy.shop.common.dto.merchant.req.AnnouncementMerchantListReq;
import com.hxzy.shop.common.dto.merchant.resp.AnnouncementDetailResp;
import com.hxzy.shop.dto.auth.req.ActivateMerchantReq;
import com.hxzy.shop.dto.auth.resp.MerchantResp;
import com.hxzy.shop.dto.merchant.req.AnnouncementIdReq;
import com.hxzy.shop.dto.merchant.resp.AnnouncementClassificationListResp;
import com.hxzy.shop.dto.merchant.resp.AnnouncementMerchantDetailResp;
import com.hxzy.shop.fallback.merchant.MerchantFallback;
import com.hxzy.shop.vo.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 功能描述: merchant商户远程访问
 *
 * @author tonneyyy
 */
@FeignClient(value = "merchant", fallback = MerchantFallback.class)
public interface MerchantFeign {


    @PostMapping("/merchant/activate")
     Result<Object> activateMerchant(@RequestBody ActivateMerchantReq req);

    /**
     * 获取商户信息
     * @return
     */
    @PostMapping("/merchant/detail")
    Result<MerchantResp> getMerchantDetail();

    /**
     * 商户门店数量限制
     * @return
     */
    @GetMapping(value = "/merchant/storeCount")
    Result<Integer> selectStoreCount( );

    /**
     * 公告查看
     * @param announcementId
     * @param userStr
     * @return
     */
    @GetMapping(value = "/announcement/announcementLook/{id}")
    Result<AnnouncementDetailResp> announcementLook(@RequestParam(value = "id") Long announcementId, @RequestHeader("User") String userStr);

    @ApiOperation("公告 获取商户当前未看公告条数")
    @PostMapping("/announcement/getAnnouncementNotLook")
    Result<Integer> getAnnouncementNotLook();

   /***************************商户公告管理*************************************/
    @ApiOperation("商户获得公告")
    @PostMapping("/announcement/getAnnouncementMerchant")
    Result<PageInfo<AnnouncementMerchantDetailResp>> getAnnouncementMerchant(@RequestBody AnnouncementMerchantListReq req);

    @ApiOperation("公告 查看")
    @PostMapping("/announcement/announcementLook")
    Result<AnnouncementDetailResp> announcementLook(@RequestBody AnnouncementIdReq req, @RequestHeader("User") String userStr);


    @ApiOperation("商户获得公告分类")
    @PostMapping("/announcement/getAnnouncementClassification/{isLook}")
    Result<List<AnnouncementClassificationListResp>> getAnnouncementClassification(@PathVariable("isLook")  Integer isLook, @RequestHeader("merchantId") String merchantId);


}
